﻿using RabbitMQ.Client;

namespace CodeMan.Rabbitmq.Common
{
    public class RabbitUtils
    {
        public static ConnectionFactory GetConnection()
        {
            var factory = new ConnectionFactory();//连接工厂
            factory.HostName = "127.0.0.1";//主机名称
            factory.Port = 5672;//端口号
            factory.UserName = "admin";//用户名
            factory.Password = "123456";//密码
            factory.VirtualHost = "my_vhost";//虚拟主机
            return factory;
        }
    }
}